//
//  RIghtCell.m
//  liangyi
//
//  Created by 张水 on 16/12/16.
//  Copyright © 2016年 yswh. All rights reserved.
//

#import "RIghtCell.h"

@implementation RIghtCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

-(void)setRightModel:(RightModel *)rightModel{
    
    _rightModel = rightModel;
//    self.backImg.image = [UIImage imageNamed:@"kangfu"];
//    [self.backImg sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",BaseIamgeUrl,rightModel.videoImg]] placeholderImage:[UIImage imageNamed:@"img_placeholder"]];
    self.courseLable.text = rightModel.name;
//    self.suitPerson.text = rightModel.fit;
//    self.starView.actualScore = [rightModel.difficulty intValue];
//    self.timelable.text = [NSString stringWithFormat:@"%@分钟",rightModel.duration];
//    self.actionsLable.text = @"5套";
//    self.watchPerson.text = @"已有1234人参见";
    

}


- (void)setupUI{
    WeakSelf(wk);
    
//    self.backImg = [[UIImageView alloc]init];
//    self.backImg.contentMode = UIViewContentModeScaleAspectFill;
//    [self.contentView addSubview:self.backImg];
//    [self.backImg mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.left.right.bottom.equalTo(wk);
//    }];
    
    
    self.courseLable = [[UILabel alloc]init];
    [self.contentView addSubview:self.courseLable];
    self.courseLable.font = [UIFont systemFontOfSize:17];
    self.courseLable.textColor = [UIColor blackColor];
    self.courseLable.textAlignment = NSTextAlignmentLeft;
    [self.courseLable mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(wk).offset(10);
        make.centerY.equalTo(wk.mas_centerY);
        make.left.equalTo(wk).offset(10);
    }];
    
    UIView *lineView = [[UIView alloc]init];
    [self.contentView addSubview:lineView];
    lineView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.equalTo(wk);
        make.left.equalTo(wk).offset(10);
        make.height.equalTo(@1);
    }];
//    UILabel *nandu = [[UILabel alloc]init];
//    [self.contentView addSubview:nandu];
//    nandu.font = [UIFont systemFontOfSize:13];
//    nandu.textAlignment = NSTextAlignmentLeft;
//    nandu.textColor = [UIColor whiteColor];
//    nandu.text = @"难度:";
//    [nandu mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.courseLable.mas_bottom).offset(10);
//        make.left.equalTo(self.courseLable.mas_left);
//    }];
//    
//    self.starView = [[HYBStarEvaluationView alloc]initWithFrame:CGRectMake(40, 40, 70, 13) numberOfStars:5 isVariable:NO];
//    [self.contentView addSubview:self.starView];
//    [self.starView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(nandu.mas_right).offset(5);
//        make.centerY.equalTo(nandu.mas_centerY);
//        make.width.equalTo(@70);
//        make.height.equalTo(@13);
//    }];
//    self.starView.fullScore = 5;
//    self.starView.isContrainsHalfStar = NO;
//    
//    
//    UILabel *shihe = [[UILabel alloc]init];
//    [self.contentView addSubview:shihe];
//    shihe.font = [UIFont systemFontOfSize:13];
//    shihe.textAlignment = NSTextAlignmentLeft;
//    shihe.textColor = [UIColor whiteColor];
//    shihe.text = @"适合:";
//    [shihe mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(nandu.mas_bottom).offset(10);
//        make.left.equalTo(self.courseLable.mas_left);
//    }];
//    
//    self.suitPerson = [[UILabel alloc]init];
//    [self.contentView addSubview:self.suitPerson];
//    [self.suitPerson mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(shihe.mas_right).offset(5);
//        make.centerY.equalTo(shihe.mas_centerY);
//    }];
//    self.suitPerson.textColor = [UIColor whiteColor];
//    self.suitPerson.textAlignment = NSTextAlignmentLeft;
//    self.suitPerson.font = [UIFont systemFontOfSize:13];
//    
//    
//    UILabel *shichang = [[UILabel alloc]init];
//    [self.contentView addSubview:shichang];
//    shichang.font = [UIFont systemFontOfSize:13];
//    shichang.textAlignment = NSTextAlignmentLeft;
//    shichang.textColor = [UIColor whiteColor];
//    shichang.text = @"时长:";
//    [shichang mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(shihe.mas_bottom).offset(10);
//        make.left.equalTo(shihe.mas_left);
//    }];
//  
//    
//    self.timelable = [[UILabel alloc]init];
//    [self.contentView addSubview:self.timelable];
//    self.timelable.textAlignment = NSTextAlignmentLeft;
//    self.timelable.textColor = [UIColor whiteColor];
//    self.timelable.font = [UIFont systemFontOfSize:13];
//    [self.timelable mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(shichang.mas_right).offset(5);
//        make.centerY.equalTo(shichang.mas_centerY);
//    }];


//    UILabel *dongzuo = [[UILabel alloc]init];
//    [self.contentView addSubview:dongzuo];
//    dongzuo.font = [UIFont systemFontOfSize:13];
//    dongzuo.textAlignment = NSTextAlignmentLeft;
//    dongzuo.textColor = [UIColor whiteColor];
//    dongzuo.text = @"动作:";
//    [dongzuo mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(shichang.mas_bottom).offset(5);
//        make.left.equalTo(shichang.mas_left);
//    }];
    
//    self.actionsLable = [[UILabel alloc]init];
//    [self.contentView addSubview:self.actionsLable];
//    self.actionsLable.textColor = [UIColor whiteColor];
//    self.actionsLable.textAlignment = NSTextAlignmentLeft;
//    self.actionsLable.font = [UIFont systemFontOfSize:13];
//    [self.actionsLable mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(dongzuo.mas_right).offset(5);
//        make.centerY.equalTo(dongzuo.mas_centerY);
//    }];

    
//    self.watchPerson = [[UILabel alloc]init];
//    [self.contentView addSubview:self.watchPerson];
//    self.watchPerson.backgroundColor = [[UIColor ColorWithHex:@"#1a1a1a"] colorWithAlphaComponent:0.4];
//    self.watchPerson.textAlignment = NSTextAlignmentCenter;
//    self.watchPerson.layer.cornerRadius = 10;
//    self.watchPerson.textColor = [UIColor whiteColor];
//    [self.watchPerson mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.right.equalTo(wk).offset(-10);
//        make.centerY.equalTo(dongzuo.mas_centerY);
//        make.width.equalTo(@200);
//        make.height.equalTo(@30);
//    }];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
}

@end
